import {
  IsString,
  IsNotEmpty,
  Length,
  IsEmail,
  IsMobilePhone,
} from 'class-validator';

export class CreateUserByEmailDto {
  @IsString()
  @IsNotEmpty()
  @IsEmail()
  readonly username: string;

  @IsString()
  @IsNotEmpty()
  @Length(8)
  readonly password: string;
}

export class CheckPhoneNumberForGenVeriCode {
  @IsString()
  @IsNotEmpty()
  @IsMobilePhone()
  readonly phoneNumber: string;
}

export class CreateByPhoneNumDto {
  @IsString()
  @IsNotEmpty()
  @IsMobilePhone()
  readonly phoneNumber: string;

  @IsString()
  @IsNotEmpty()
  @Length(4)
  readonly veriCode: string;
}
